home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-26 | 838 b | 44 lines | [TEXT/CWIE] |
-
- // mail <chelly@eden.com> or surf http://www.eden.com/~chelly for feedback
- // free source code - do whatever you like with it
-
- // sequential access to file data
- // automatically swaps multi-byte integral types, so it's easier to use
-
- #ifndef stream_H
- #define stream_H
-
- #include "common.h"
-
- #include <stdio.h> // for FILE structure
-
- class stream {
- public:
-
- stream( const char* path_of_file ); // open file
- ~stream();
-
- // go to offset in file
- void set_mark( long new_mark );
-
- // skip n bytes in file
- void skip( long n_bytes );
-
- // read n bytes from file into storage
- void get_bytes( void* storage, long n );
-
- // read a byte from the file
- uint8 get_uint8();
-
- // read a word from file in big endian format (and swap if necessary )
- uint16 get_mac_uint16();
- uint32 get_mac_uint32();
-
- private:
-
- FILE* m_file;
- };
-
- #endif
-
-